package br.com.amethyst.workflow.source;

import javax.xml.transform.stream.StreamSource;
import br.com.amethyst.workflow.exception.WorkflowSourceLoadException;
import br.com.amethyst.workflow.exception.WorkflowSourceValidationException;

/**
 * Workflow Source interface, used as basic object
 * to workflow processing
 * 
 * @author Artur Figueira <arturfigueira@gmail.com>
 *
 */
public interface IWorkflowSource 
{
	public static final int WS_XPDL			= 0;
	public static final int WS_VISTRAILS	= 1;
	public static final int WS_KEPLER		= 2;
	public static final int WS_TAVERNA		= 3;
	
	/**
	 * Load a sourceFile from it's path
	 * @param sourcePath Path of this sourceFile
	 * @throws WorkflowSourceLoadException
	 */
	public void load(String sourcePath) throws WorkflowSourceLoadException;
	
	/**
	 * Validate if this Source is a XML file and if it's valid and well-formated
	 * @return True if it's valid or False case contrary
	 * @throws WorkflowSourceValidationException
	 */
	public boolean doValidate() throws WorkflowSourceValidationException;
	
	/**
	 * Get a StreamSource instance
	 * @return StreamSource loaded previously
	 */
	public StreamSource getSource();
	
	
	/**
	 * Check whether we must validate a XSD Schema or not
	 */
	public void noNameSpaceLocation();
}
